<template>
	<view class="uni-steps">
		<view :class="[direction==='column'?'uni-steps__column':'uni-steps__row']">
			<view :class="[direction==='column'?'uni-steps__column-text-container':'uni-steps__row-text-container']">
				<view v-for="(item,index) in options" :key="index" :class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']"  :style="item.status==5||item.status==6?'height:125px':'height:140rpx'">
				
					
					<text v-if="item.status==5" style="font-size: 26rpx;color: #7B7B7B;font-weight: 400;" :style="{Color:index==active?activeColor:'#7B7B7B'}" :class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{qbj}}货物(实取件数</text><text v-if="item.status==5">{{item.sjqs}}件</text>
					<text v-if="item.status==5"  :style="{Color:index==active?activeColor:'#7B7B7B'}"  class="hbj">）{{hbj}}</text>
						
					
					<text v-else style="font-size: 26rpx;color: #7B7B7B;font-weight: 400;" :style="{Color:index==active?activeColor:'#7B7B7B'}" :class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
					
					
					<text style="font-size: 24rpx;color: #7B7B7B;font-weight: 400;margin-left: 12rpx;" :style="{Color:index==active?activeColor: '#7B7B7B'}"  :class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text>
					
						<scroll-view scroll-x="true"  v-if="item.status==6&&optionss.length!==0"   style="overflow: hidden;white-space: nowrap;width: 300px;">
							<view   @click="alert0()" style="display: inline-block;width: 120rpx;height: 120rpx;" v-for="(items,indexs) in optionss"  ><image  :src="items"  style="width: 120rpx;height: 120rpx;" mode=""></view>
						</scroll-view>
						<scroll-view scroll-x="true"  v-if="item.status==5&&optiones.length!==0"   style="overflow: hidden;white-space: nowrap;width: 300px;">
							<view   @click="alert1()" style="display: inline-block;width: 120rpx;height: 120rpx;" v-for="(items,indexs) in optiones"  ><image  :src="items"  style="width: 120rpx;height: 120rpx;" mode=""></view>
						</scroll-view>
						
				</view>
			</view>
			<view :class="[direction==='column'?'uni-steps__column-container':'uni-steps__row-container']">
				<view :class="[(index==1&&(optionss.length!==0||optiones.length!==0))||(optiones.length!==0&&index==2&&optionss.length!==0)?'uni-steps__column-line-items':'uni-steps__column-line-item']" v-for="(item,index) in options"  
				 :key="index">
					<view :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',(index==1&&(optionss.length!==0||optiones.length!==0))||(optiones.length!==0&&index==2&&optionss.length!==0)?'uni-steps__columns-line--before':'uni-steps__column-line--before']"
					 :style="{backgroundColor:index<=active&&index!==0?'':index===0?'transparent':''}"></view>
					<view :class="[direction==='column'?'uni-steps__column-circle':'uni-steps__row-circle']"  :style="{backgroundColor:index==active?activeColor:deactiveColor}"></view>
					<view :class="[direction==='column'?'uni-steps__column-line':'uni-steps__row-line',direction==='column'?'uni-steps__column-line--after':'uni-steps__row-line--after']"
					 :style="{backgroundColor:index<active&&index!==options.length-1?'':index===options.length-1?'transparent':''}"   ></view>
				</view>
			</view>
		</view>
		<vus-layer></vus-layer>
	</view>
</template>

<script>
	import uniIcons from '../uni-icons/uni-icons.vue'
	import vusPhotos from '../vusui-app-layer/vus-photos.vue';
	import vusMask from "../vusui-app-layer/vus-mask.vue";
	export default {
		name: 'UniSteps',
		components: {
			uniIcons,
			vusPhotos,
			vusMask
		},
		props: {
			direction: {
				// 排列方向 row column
				type: String,
				default: 'row'
			},
			activeColor: {
				// 激活状态颜色
				type: String,
				default: '#FF690D'
			},
			deactiveColor: {
				// 未激活状态颜色
				type: String,
				default: '#D8D8D8'
			},
			active: {
				// 当前步骤
				type: Number,
				default: 0
			},
			options: {
				type: Array,
				default () {
					return []
				}
			} ,
			optionss:{
				type: Array,
				default () {
					return []
				}
			},
			optiones:{
				type: Array,
				default () {
					return []
				}
			}
		},
		data() {
			return {
				qstp:[],
				qbj:'',
				hbj:'',
				qstps:[]
			}
		},
		
		mounted() {
			
			
			for(let i=0;i<this.optionss.length;i++){
				let obj={}
				console.log('this.optionss',this.optionss)
				obj.src=this.optionss[i]
				console.log('this.obj',obj)
				this.qstp.push(obj)
				console.log('this.qstp',this.qstp)
			}
			
			for(let i=0;i<this.optiones.length;i++){
				let obj={}
				console.log('this.optionss',this.optionss)
				obj.src=this.optiones[i]
				console.log('this.obj',obj)
				this.qstps.push(obj)
				console.log('this.qstp',this.qstp)
			}
			
			console.log('this.options',this.options)
			for(let i=0;i<this.options.length;i++){
				console.log(this.options[i]['title'])
				if(this.options[i]['status']==5){
				let str=this.options[i]['title']
					console.log(str.substring(0, str.indexOf("货")))
					this.qbj=str.substring(0, str.indexOf("货"))
					
					this.hbj=str.substring(this.qbj.length+1, str.length)
					console.log('klkl',this.hbj)
				}
				
				
			}
			
		},
		
		methods:{
			alert0() {
				 this.vusui.photos({
				                title: true, //显示图片标题
				                number: true, //显示页码
				                content: this.qstp
				            })
			},
			alert1() {
				 this.vusui.photos({
				                title: true, //显示图片标题
				                number: true, //显示页码
				                content: this.qstps
				            })
			},
		}
	}
</script>

<style lang="scss" scoped>
	.uni-steps {
		/* #ifndef APP-NVUE */
		display: flex;
		width: 100%;
		/* #endif */
		/* #ifdef APP-NVUE */
		flex: 1;
		/* #endif */
		flex-direction: column;
	}

	.uni-steps__row {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
	}

	.uni-steps__column {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row-reverse;
	}

	.uni-steps__row-text-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
	}

	.uni-steps__column-text-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		flex: 1;
		
	}
	
	.uni-steps__column-text-container:last-child view{
		height: 40px !important;
	}

	.uni-steps__row-text {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		flex: 1;
		flex-direction: column;
	}

	.uni-steps__column-text {
		
	
		
	}

	.uni-steps__row-title {
		font-size: $uni-font-size-base;
		line-height: 32rpx;
		text-align: center;
	}

	.uni-steps__column-title {
		font-size: 24rpx;
		text-align: right;
		line-height: 1.6;
		
	}

	.uni-steps__row-desc {
		font-size: 24rpx;
		line-height: 28rpx;
		text-align: center;
	}

	.uni-steps__column-desc {
		font-size: $uni-font-size-sm;
		text-align: left;
		line-height: 36rpx;
	}

	.uni-steps__row-container {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: row;
	}

	.uni-steps__column-container {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		width: 42rpx;
		flex-direction: column;
	}

	.uni-steps__row-line-item {
		/* #ifndef APP-NVUE */
		display: inline-flex;
		/* #endif */
		flex-direction: row;
		flex: 1;
		height: 28rpx;
		line-height: 28rpx;
		align-items: center;
		justify-content: center;
	}

	.uni-steps__column-line-item {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		
		align-items: center;
		justify-content: center;
	}
	
	.uni-steps__column-line-items {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: column;
		
		align-items: center;
		justify-content: center;
	}

	.uni-steps__row-line {
		flex: 1;
		height: 2rpx;
		background-color: #D8D8D8;
	}

	.uni-steps__column-line {
		width: 2rpx;
		background-color: #D8D8D8;
	}

	.uni-steps__row-line--after {
		
	}

	.uni-steps__column-line--after {
		
		transform: translate(0px, 0px);
	}

	.uni-steps__row-line--before {
		transform: translateX(0px);
	}

	.uni-steps__column-line--before {
		height: 130rpx;
		transform: translate(0px, 0px);
	}
	
	.uni-steps__columns-line--before {
		height: 220rpx;
		transform: translate(0px, 0px);
	}
	
	.uni-steps__column-line-item:first-child  .uni-steps__column-line--before{
		height: 0rpx !important;
		transform: translate(0px, 0px);
		
	}
	
	.uni-steps__column-line-items:nth-child(2)  .uni-steps__column-line--before{
		height: 110rpx !important;
		transform: translate(0px, 0px);
		
	}
	
	.uni-steps__column-line-item:last-child  .uni-steps__column-line--after{
		height: 95rpx !important;
		transform: translate(0px, 0px);
		
	}
	
	.uni-steps__column-container{
		padding: 12rpx 0  0;
	}

	.uni-steps__row-circle {
		width: 10rpx;
		height: 10rpx;
		border-radius: 200rpx;
		background-color: $uni-text-color-grey;
		margin: 0px 6rpx;
	}

	.uni-steps__column-circle {
		width: 16rpx;
		height: 16rpx;
		border-radius: 200rpx;
		background-color: $uni-text-color-grey;
		
	}

	.uni-steps__row-check {
		margin: 0px 12rpx;
	}

	.uni-steps__column-check {
		height: 28rpx;
		line-height: 28rpx;
		margin: 4rpx 0px;
	}
	
	.hbj{
		font-size: 26rpx;font-weight: 400;color: #7B7B7B;
	}
</style>
